﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace RbacPermissionManage.Repository.Migrations
{
    public partial class menu123 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Menu",
                columns: table => new
                {
                    MenuId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MenuName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    MenuType = table.Column<int>(type: "int", nullable: false),
                    RouteName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    RoutePath = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ComponentPath = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Icon = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Permission = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    ParentId = table.Column<int>(type: "int", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Menu", x => x.MenuId);
                });

            migrationBuilder.InsertData(
                table: "Menu",
                columns: new[] { "MenuId", "ComponentPath", "CreateName", "CreateTime", "DelName", "DelTime", "Icon", "IsDel", "MenuName", "MenuType", "ParentId", "Permission", "Remark", "RouteName", "RoutePath", "UpdateName", "UpdateTime" },
                values: new object[,]
                {
                    { 1, null, null, null, null, null, null, false, "系统设置", 0, 0, null, null, "system", "/system", null, null },
                    { 2, "system/user/index", null, null, null, null, null, false, "账号管理", 1, 1, null, null, "system:user", "user", null, null },
                    { 3, null, null, null, null, null, null, false, "查询", 2, 2, "system:user:page", null, null, null, null, null },
                    { 4, null, null, null, null, null, null, false, "添加", 2, 2, "system:user:create", null, null, null, null, null },
                    { 5, null, null, null, null, null, null, false, "编辑", 2, 2, "system:user:edit", null, null, null, null, null },
                    { 6, null, null, null, null, null, null, false, "删除", 2, 2, "system:user:delete", null, null, null, null, null },
                    { 7, null, null, null, null, null, null, false, "批量删除", 2, 2, "system:user:batchdelete", null, null, null, null, null }
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Menu");
        }
    }
}
